package org.test2;

import org.opencv.core.*;
import org.opencv.highgui.HighGui;
import org.opencv.imgproc.Imgproc;

import java.util.Arrays;

import static org.opencv.core.CvType.CV_8U;

public class Test1 {

    public static void main(String[] args) {

        // 加载 opencv_javaXX.dll
        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

        Mat mat = Mat.zeros(new Size(400,400), CV_8U);
        Scalar color = new Scalar(255);

        MatOfPoint point1 = new MatOfPoint();
        point1.fromArray(new Point(0,0), new Point(30,40), new Point(80,150),new Point(100,300), new Point(130,280), new Point(180,150),new Point(300,500));

        Imgproc.polylines(mat, Arrays.asList(point1), true, color, 1, Imgproc.LINE_8);

        HighGui.imshow("demo", mat);
        HighGui.waitKey();
    }
}
